import request from '@/utils/request'

// 查询零售订单列表
export function listOrder(query) {
  return request({
    url: '/order/list',
    method: 'get',
    params: query
  })
}

// 查询零售订单详细
export function getOrder(id) {
  return request({
    url: '/order/' + id,
    method: 'get'
  })
}

// 新增零售订单
export function createOrder(data) {
  return request({
    url: '/order',
    method: 'post',
    data: data
  })
}

// 修改零售订单
export function updateOrder(data) {
  return request({
    url: '/order',
    method: 'put',
    data: data
  })
}

// 删除零售订单
export function delOrder(id) {
  return request({
    url: '/order/' + id,
    method: 'delete'
  })
}


// 请求三方支付
export function lqlPay(data) {
  return request({
    url: '/mall/order/onlinePay/lql/pay',
    method: 'post',
    data: data
  })
}

// 修改零售订单
export function confirmReceipt(data) {
  return request({
    url: '/order/confirmReceipt',
    method: 'put',
    data: data
  })
}

//急速退款
export function quickRefund(data) {
  return request({
    url: '/mall/order/onlinePay/quick/refund',
    method: 'post',
    data: data
  })
}

//根据订单号查询订单物流信息
export function getLogisticsInfo(data) {
  return request({
    url: '/order/getLogisticsInfo',
    method: 'post',
    data: data
  })
}

// 修改零售订单
export function refundApply(data) {
  return request({
    url: '/order/refundApply',
    method: 'put',
    data: data
  })
}

// 修改订单地址
export function updateOrderAddress(data) {
  return request({
    url: '/order/address/updateByOrderId',
    method: 'put',
    data: data
  })
}

//获取订单角标
export function queryOrderNum(data) {
  return request({
    url: '/order/queryOrderNum',
    method: 'post',
    data: data
  })
}

//根据订单id查看售后详情
export function queryByOrderId(id) {
  return request({
    url: '/order/address/queryByOrderId/' + id,
    method: 'get'
  })
}